﻿using System.Collections.Generic;

namespace System.Linq.Functional
{
    public static class SequenceExtensions
    {
        // F# Seq.iter
        public static void ForEach<T>(this IEnumerable<T> items, Action<T> action)
        {
            if (items == null) throw new ArgumentNullException("items");
            if (action == null) throw new ArgumentNullException("action");

            foreach (var item in items)
                action(item);
        }
    }
}
